#include "geometrybuilder.h"

namespace dw {
	namespace graffiti {

const dw::byte GeometryBuilder::cubeIndices[GeometryBuilder::cubeIndicesCount] = {
	0, 1, 2, 2, 3, 0, // back
	3, 2, 6, 6, 7, 3, // left
	7, 6, 5, 5, 4, 7, // front
	4, 5, 1, 1, 0, 4, // right
	1, 5, 6, 6, 2, 1, // top
	4, 0, 3, 3, 7, 4  // bottom
};
		
const glm::vec3 GeometryBuilder::cubeVertices[GeometryBuilder::cubeVerticesCount * 2] = {
	glm::vec3(-1.0f, -1.0f, -1.0f), glm::vec3(0.0f, 0.0f, 0.0f),
	glm::vec3(-1.0f,  1.0f, -1.0f), glm::vec3(0.0f, 1.0f, 0.0f),
	glm::vec3( 1.0f,  1.0f, -1.0f), glm::vec3(1.0f, 1.0f, 0.0f),
	glm::vec3( 1.0f, -1.0f, -1.0f), glm::vec3(1.0f, 0.0f, 0.0f),
	glm::vec3(-1.0f, -1.0f,  1.0f), glm::vec3(0.0f, 0.0f, 1.0f),
	glm::vec3(-1.0f,  1.0f,  1.0f), glm::vec3(0.0f, 1.0f, 1.0f),
	glm::vec3( 1.0f,  1.0f,  1.0f), glm::vec3(1.0f, 1.0f, 1.0f),
	glm::vec3( 1.0f, -1.0f,  1.0f), glm::vec3(1.0f, 0.0f, 1.0f)
};

const glm::vec3 GeometryBuilder::cubeNormals[6] = {
	glm::vec3( 0.0f,  0.0f, -1.0f), // back
	glm::vec3( 1.0f,  0.0f,  0.0f), // left
	glm::vec3( 0.0f,  0.0f,  1.0f), // front
	glm::vec3(-1.0f,  0.0f,  0.0f), // right
	glm::vec3( 0.0f,  1.0f,  0.0f), // top
	glm::vec3( 0.0f, -1.0f,  0.0f)  // bottom
};

const dw::byte GeometryBuilder::icoIndices[] = {
	 0,  1,  2,
	 0,  2,  3,
	 0,  3,  4,
	 0,  4,  5,
	 0,  5,  1,
	 7,  6, 11,
	 8,  7, 11,
	 9,  8, 11,
	10,  9, 11,
	 6, 10, 11,
	 6,  2,  1,
	 7,  3,  2,
	 8,  4,  3,
	 9,  5,  4,
	10,  1,  5,
	 6,  7,  2,
	 7,  8,  3,
	 8,  9,  4,
	 9, 10,  5,
	10,  6,  1
};

const glm::vec3 GeometryBuilder::icoVertices[GeometryBuilder::icoVerticesCount] = {
	glm::vec3( 0.000f,  0.000f,  1.000f),
	glm::vec3( 0.894f,  0.000f,  0.447f),
	glm::vec3( 0.276f,  0.851f,  0.447f),
	glm::vec3(-0.724f,  0.526f,  0.447f),
	glm::vec3(-0.724f, -0.526f,  0.447f),
	glm::vec3( 0.276f, -0.851f,  0.447f),
	glm::vec3( 0.724f,  0.526f, -0.447f),
	glm::vec3(-0.276f,  0.851f, -0.447f),
	glm::vec3(-0.894f,  0.000f, -0.447f),
	glm::vec3(-0.276f, -0.851f, -0.447f),
	glm::vec3( 0.724f, -0.526f, -0.447f),
	glm::vec3( 0.000f,  0.000f, -1.000f)
};

	} // namespace graffiti
} // namespace dw
